package com.dailyblue.java.project.bookstore.pubinfo.service.impl;

import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dailyblue.java.project.bookstore.pubinfo.bean.PubInfo;
import com.dailyblue.java.project.bookstore.pubinfo.mapper.PubInfoMapper;
import com.dailyblue.java.project.bookstore.pubinfo.service.PubInfoService;
import com.dailyblue.java.project.bookstore.pubinfo.util.JsonResult;
import com.dailyblue.java.project.bookstore.pubinfo.util.ResultTool;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class PubInfoServiceImpl extends ServiceImpl<PubInfoMapper, PubInfo> implements PubInfoService {

    @Cacheable(cacheNames = "findPubInfoById", key = "#id")
    public JsonResult findPubInfoById(int id) {
        return ResultTool.success(getById(id));
    }
}
